package com.yang.concurrency.chapter4;

/**
 * @Author: 血魔
 * @Date: Created in 15:18 2021/12/12
 * @Version: $
 */
public class DeamonThread01 {
    public static void main(String[] args) throws InterruptedException {
        Thread t = new Thread(new Runnable() {

            @Override
            public void run() {
                System.out.println(Thread.currentThread().getName()+" running");
                try {
                    Thread.sleep(1000*100);
                    System.out.println(Thread.currentThread().getName() + "dead");
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
        }); //new

        // runnable -> running| -> dead| -> blocked
        t.start();

        Thread.sleep(50_1000);
        System.out.println(Thread.currentThread().getName());

    }
}
